﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
	class Program
	{
		static void Main(string[] args)
		{
			DateTime dt = DateTime.Now;
			Console.WriteLine("当前日期：{0}",dt);
			Console.WriteLine("当前是本月的第{0}天", dt.Day);
			Console.WriteLine("当前是：{0}",dt.DayOfWeek);
			Console.WriteLine("当前是本季度的第{0}天",dt.DayOfYear);
			Console.WriteLine("25天后是{0}",dt.AddDays(25));
			Console.WriteLine("8分钟后的时间{0}:" , dt.AddMinutes(8));
			Console.WriteLine("10秒过后的时间" ,dt.AddSeconds(10));


			Birth.Age();
			
			string movic = "王牌逗王牌";
			Console.WriteLine("这部电影名字是{0}个字",movic.Length);
			for (int i = 0; i <= movic.Length - 1; i++)
			{
				Console.WriteLine(movic[i]);
			}
			Console.WriteLine("第一次出现的位置：" + movic.IndexOf("王"));
			Console.WriteLine("最后一次出现的位置：" + movic.LastIndexOf("王"));
			Console.WriteLine("判断是否以王开头：" + movic.StartsWith("王"));
			Console.WriteLine("判断是否以牌结尾：" + movic.EndsWith("牌"));

			string name = "Zhiqiangshi";
			Console.WriteLine("全部小写{0}",name.ToLower());
			Console.WriteLine("全部大写{0}",name.ToUpper());


			string code = "    90      code    ";
			//删除左侧填充空格
			Console.WriteLine(code.TrimStart());
			//删除右侧填充空格
			Console.WriteLine(code.TrimEnd());

			string cla = "class";
			//左侧填充空格
			Console.WriteLine(cla.PadLeft(10));
			//右侧填充空格
			Console.WriteLine(cla.PadRight(20));
			//插入 前一个参数是第n-1位字符  后一个参数是要插入的字符
			Console.WriteLine(cla.Insert(2,"o"));


			
		}
	}
}
